package org.jeecg.common.modules.articleSet.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 文章设置
 * @Author: jeecg-boot
 * @Date:   2021-10-22
 * @Version: V1.0
 */
@Data
@TableName("article_set")
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="article_set对象", description="文章设置")
public class ArticleSet implements Serializable {
    private static final long serialVersionUID = 1L;

    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private java.lang.String id;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private java.lang.String createBy;
    /**创建日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private java.util.Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private java.lang.String updateBy;
    /**更新日期*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private java.util.Date updateTime;
    /**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private java.lang.String sysOrgCode;
    /**标题*/
    @Excel(name = "标题", width = 15)
    @ApiModelProperty(value = "标题")
    private java.lang.String articleTitle;
    /**类型 医馆0，文章1*/
    @Excel(name = "类型 医馆0，文章1", width = 15)
    @ApiModelProperty(value = "类型 医馆0，文章1")
    private java.lang.String articleType;
    /**伪删除 正常0，删除1*/
    @Excel(name = "伪删除 正常0，删除1", width = 15)
    @ApiModelProperty(value = "伪删除 正常0，删除1")
    private java.lang.String invalid;
    /**阅读量*/
    @Excel(name = "阅读量", width = 15)
    @ApiModelProperty(value = "阅读量")
    private java.lang.Integer readingTotal;
    /**标题图片*/
    @Excel(name = "标题图片", width = 15)
    @ApiModelProperty(value = "标题图片")
    private java.lang.String headImg;
    /**审核状态 0 未上线，1上线，2定时*/
    @Excel(name = "审核状态 0 未上线，1上线，2定时", width = 15)
    @ApiModelProperty(value = "审核状态 0 未上线，1上线，2定时")
    private java.lang.String status;
    /**置顶时间*/
    @Excel(name = "置顶时间", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "置顶时间")
    private java.util.Date makeTopTime;
    /**文章内容*/
    @Excel(name = "文章内容", width = 15)
    private transient java.lang.String articleContentString;

    private byte[] articleContent;

    public byte[] getArticleContent(){
        if(articleContentString==null){
            return null;
        }
        try {
            return articleContentString.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getArticleContentString(){
        if(articleContent==null || articleContent.length==0){
            return "";
        }
        try {
            return new String(articleContent,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
    /**类型 图文0，视频1，患者讲述2，医生说3，专栏4*/
    @Excel(name = "类型 图文0，视频1，患者讲述2，医生说3，专栏4", width = 15)
    @ApiModelProperty(value = "类型 图文0，视频1，患者讲述2，医生说3，专栏4")
    private java.lang.String type;
    /**下载 不允许0，允许1*/
    @Excel(name = "下载 不允许0，允许1", width = 15)
    @ApiModelProperty(value = "下载 不允许0，允许1")
    private java.lang.String allowdDown;
    /**上架状态，0立即上架，1定时上架暂定上架*/
    @Excel(name = "上架状态，0立即上架，1定时上架暂定上架", width = 15)
    @ApiModelProperty(value = "上架状态，0立即上架，1定时上架暂定上架")
    private java.lang.String isShelvesStatus;
    private String doctorId;
}
